package com.baijiaoxi.common.model.asyncjob;

import com.baijiaoxi.common.model.mq.MQBody;

public interface AsyncJobProducer {

    default void publish(String topic, MQBody data) {
        publish(topic, data, new DefaultAsyncJobPublishCallback());
    }

    void publish(String topic, MQBody data, AsyncJobPublishCallback asyncJobPublishCallback);

    default void republish(String topic, MQBody data, AsyncJobPublishCallback asyncJobPublishCallback) {

    }

    default void republish(String topic, MQBody data) {
        republish(topic, data, new DefaultAsyncJobPublishCallback());
    }
}
